var path = require('path');

//错误日志输出完整路径
var errorLogPath = path.resolve(__dirname, "../logs/error/error");

//响应日志输出完整路径
var responseLogPath = path.resolve(__dirname, "../logs/response/response");

var old = {
    "appenders":
    [
        //错误日志
        {
            "category":"errorLogger",             //logger名称
            "type": "dateFile",                   //日志类型
            "level": "ERROR",
            "filename": errorLogPath,             //日志输出位置
            "alwaysIncludePattern":true,          //是否总是有后缀名
            "pattern": "[yyyy-MM-dd-hh].log"       //后缀，每小时创建一个新的日志文件
        },
        //响应日志
        {
            "category":"resLogger",
            "type": "dateFile",
            "level": "ALL",
            "filename": responseLogPath,
            "alwaysIncludePattern":true,
            "pattern": "[yyyy-MM-dd-hh].log"
        }
    ]
}

module.exports = {
    appenders: {
        errorLogger: {
            type: 'dateFile',
            filename: errorLogPath,
            alwaysIncludePattern: true,
            pattern: '[yyyy-MM-dd-hh].log'
        },
        resLogger: {
            type: 'dateFile',
            filename: responseLogPath,
            alwaysIncludePattern: true,
            pattern: '[yyyy-MM-dd-hh].log'
        }
    },
    categories: {
        default: {
            appenders: ['resLogger'],
            level: 'error'
        },
        errorLogger: {
            appenders: ['errorLogger'],
            level: 'all'
        },
        resLogger: {
            appenders: ['resLogger'],
            level: 'all'
        }
    }
}
